Skip to content

Conversation

@martintopholm
Copy link
Contributor

First patch will add support for resending mtu messages to designated L3 peers. Second patch will add a direction filter to pcap, so only inboud packets are considered.

@majek
Copy link
Contributor

majek commented Feb 2, 2016

Ok, I don't mind this PR in spirit. But I do mind the implementation.
a) can you move the implementation details (memcpy!) out of the main file. maybe net.c?
b) the same for other things, maybe utils.c is a beter place
c) Please document it in the README
d) I'm not a fan of linked lists implemented manaully, I probably would go for a fixed-sized array (with some assumption that you will have at most, say 32 entries, ie: simplicity, just one free() instead of a loop in the end). But it's not a big deal.
e) getaddrinfo should definitely be abstracted in net.c
f) I'm not sure what's the IP_TTL / IPV6_UNICAST_HOPS about. Can you explain why this is needed?

So basically - more and nicer abstractions please.

The PCAP_D_IN part could be merged right away, so please pull these 4 lines to a separate PR.
(Correction, I'll cherry-pick this commit)

Finally, I think the same stuff can be achieved with iptables TEE module:

... -t mangle -A PREROUTING -i eth0 -j TEE --gateway 2001:db8::1

Am I right?

@martintopholm
Copy link
Contributor Author

martintopholm commented Feb 4, 2016 via email

Instead of broadcasting mtu messages in the L2 domain, enable L3
forwarding to a list of peers specified on the command line (--peers).
If using a peer_list open a raw socket to delegate routing to the OS.

Introduce additional check if the packet is sourced from a peer in
peer_list, before transmitting. Also pluck the TTL from the inbound
packet in order to decrease it before forwarding.
@martintopholm
Copy link
Contributor Author

I have tried to work in the requested changes in the recent push to the l3-forward branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants